package org.shiro.config;

import org.shiro.Interceptor.AuthenticationInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 拦截器配置
 *
 * @author 党怡承
 * @version 1.0
 * @date 2021-04-24 16:29
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
  @Override
  public void addInterceptors(InterceptorRegistry registry) {
    registry.addInterceptor(authenticationInterceptor()).addPathPatterns("/**");
  }

  private AuthenticationInterceptor authenticationInterceptor() {
    return new AuthenticationInterceptor();
  }
}
